//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
typedef struct 
{
	U16		u16ItemCnt;	// number of bought item
	U16		u16ItemColor;// color of item
	U32		u32SnItem;	// serial of item
	U32		u32ModelId;	// model id of item
	Vec3f	vItemPos;	// item position in container
}ContainerItemStruct;


class PktContainerContent : public VxPktHdr
{
public:
	PktContainerContent()
	{
		m_u16PktType = PKT_TYPE_CONTAINER_CONTENT;
	}
	void CalcLen( U16 u16ItemCnt )
	{
		//calculate length of packet from msg len including null terminator
		m_u16PktLen = ROUND_TO_16BYTE_BOUNDRY( ( sizeof( PktContainerContent ) - (PKT_MAX_CONTAINER_CONTENT_CNT * sizeof( ContainerItemStruct )) +  (u16ItemCnt * sizeof( ContainerItemStruct ))) );
	}
	U32 u32SnContainer;
	U16 u16ItemCnt; // number of item stacks in container
	ContainerItemStruct agItems[ PKT_MAX_CONTAINER_CONTENT_CNT ];
};